<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>打印采购订单内容</title>
    <%= stylesheet_link_tag "/stylesheets/print.css" %>
    <style type="text/css">
      .table{margin:auto;border-collapse:collapse; font-size:16px; height:24px; line-height:24px;}
      .table tr td{border:solid 1px;}
      body{text-alitn:center}
    </style>
  </head>
  <body style="text-alitn:center">
    <table width="1010" class="table" >
      <thead>
        <tr>
          <td width="110" style="text-align:center">商品编号</td>
          <td width="140" style="text-align:center">商品全名</td>
          <td width="230" style="text-align:center">商品型号</td>
          <td width="50" style="text-align:center">单位</td>
          <td width="50" style="text-align:center">数量</td>
          <td width="75" style="text-align:center">单价</td>
          <td width="100" style="text-align:center">金额</td>
          <td width="100" style="text-align:center">已发货数量</td>
          <td width="150" style="text-align:center">备注</td>
        </tr>
      </thead>
      <%@purchaseOrderDetails.each do |purchaseOrderDetail|%>
        <tr>
          <td > &nbsp;<%=purchaseOrderDetail.product.number%></td>
          <td > &nbsp;<%=purchaseOrderDetail.product.name.split(/:/)[0]%></td>
          <td > &nbsp;<%=purchaseOrderDetail.product.name.split(/:/)[1]%></td>
          <td ><div align="center"><%=purchaseOrderDetail.product.unit%>&nbsp;&nbsp;</div> </td>
          <td ><div align="right"><%=purchaseOrderDetail.quantity%>&nbsp;&nbsp;</div> </td>
          <td ><div align="right"><%= number_with_delimiter('%.10f' % purchaseOrderDetail.unit_price)%>&nbsp;&nbsp;</div> </td>
          <td ><div align="right"><%=number_with_delimiter('%.10f' % purchaseOrderDetail.amount)%>&nbsp;&nbsp;</div> </td>
          <td ><div align="right">&nbsp;&nbsp;</div> </td>
          <td ><div align="right"><%=purchaseOrderDetail.description%>&nbsp;&nbsp;</div> </td>
        </tr>
      <% end%>
      <tr>
        <td > </td>
        <td > </td>
        <td > </td>
        <td >总计:</td>
        <td > <div align="right"><%=@totalQuantity%>&nbsp;&nbsp;</div></td>
        <td > </td>
        <td ><div align="right"><%= number_with_delimiter( '%.10f' % @purchaseOrder.amount) %>&nbsp;&nbsp;</div> </td>
        <td > </td>
        <td > </td>
      </tr>
    </table>
  </body>
</html>